package org.tobaccomain.pojo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    //定制统一的返回值
    private Integer code;//返回状态码（1成功，0失败）
    private String message;//返回信息
    private Object data;//返回数据

    public static Result success(String message){
        return new Result(1,message,null);
    }
    public static Result success(Object data){
        return new Result(1,"响应成功",data);
    }
    public static Result error(String message){
        return new Result(0,message,null);
    }
}
